home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 #2 / Ham Radio 2000 - Volume 2.iso / HAMV2 / TCP_IP / TNOS230S / SLIP.H < prev    next >
Encoding:
C/C++ Source or Header  |  1997-05-24  |  2.2 KB  |  64 lines

  1. /* Mods by G1EMM */
  2. #ifndef _SLIP_H
  3. #define _SLIP_H
  4.   
  5. #ifndef _GLOBAL_H
  6. #include "global.h"
  7. #endif
  8.   
  9. #ifndef _IFACE_H
  10. #include "iface.h"
  11. #endif
  12.   
  13. #ifndef _SLHC_H
  14. #include "slhc.h"
  15. #endif
  16.   
  17. #define _SLIP_MAX 5      /* Default maximum number of slip channels */
  18. extern int SLIP_MAX;     /* Selected maximum number of slip channels */
  19.   
  20. /* SLIP definitions */
  21. #define SLIP_ALLOC  100 /* Receiver allocation increment */
  22.   
  23. #define FR_END      0300    /* Frame End */
  24. #define FR_ESC      0333    /* Frame Escape */
  25. #define T_FR_END    0334    /* Transposed frame end */
  26. #define T_FR_ESC    0335    /* Transposed frame escape */
  27.   
  28. /* Slip protocol control structure */
  29. struct slip {
  30.     struct iface *iface;
  31.     char escaped;       /* Receiver State control flag */
  32. #define SLIP_FLAG    0x01        /* Last char was a frame escape */
  33. #define SLIP_VJCOMPR    0x02        /* TCP header compression enabled */
  34.     struct mbuf *rbp_head;  /* Head of mbuf chain being filled */
  35.     struct mbuf *rbp_tail;  /* Pointer to mbuf currently being written */
  36.     char *rcp;      /* Write pointer */
  37. #if 0
  38.     int16 rcnt;     /* Length of mbuf chain */
  39.     struct mbuf *tbp;   /* Transmit mbuf being sent */
  40. #endif
  41.     int16 errors;       /* Receiver input errors */
  42.     int type;       /* Protocol of input */
  43.     int (*send) (int,struct mbuf *);    /* send mbufs to device */
  44.     int (*get) (int);   /* fetch input chars from device */
  45.     struct slcompress *slcomp;  /* TCP header compression table */
  46.     struct iface *kiss[16];     /* sub nodes  AX25 only */
  47.     int rx;                     /* set if a frame is being received */
  48.     int polled;                 /* Indicate a polled kiss link */
  49.     int usecrc;                 /* Should we use a CRC on a kiss link */
  50.     char rxcrc;                 /* CRC for receiving polled frames */
  51.     int tracepoll;        /* set if outgoing poll requests are to display in trace */
  52. };
  53.   
  54. /* In slip.c: */
  55. extern struct slip *Slip;
  56.   
  57. void asy_rx (int xdev,void *p1,void *p2);
  58. int slip_raw (struct iface *iface,struct mbuf *data);
  59. int slip_send (struct mbuf *bp,struct iface *iface,uint32 gateway,int prec,
  60. int del,int tput,int rel);
  61. void slip_status (struct iface *iface);
  62.   
  63. #endif  /* _SLIP_H */
  64.